package com.exam.commonbiz.api;

import com.exam.commonbiz.bean.MessageInfo;
import com.exam.commonbiz.bean.UserInfo;
import com.exam.commonbiz.net.BaseResponse;

import org.json.JSONObject;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * @Author yuexingxing
 * @time 2020/6/11
 */
public interface CommonApiService {

    @GET("wx/user/{id}")
    Observable<BaseResponse<UserInfo>> getUserInfo(@Path("id") String id);

    @POST("wx/user/register")
    Observable<BaseResponse> register(@Body UserInfo userInfo);

    @POST("wx/user/masterlogin")
    Observable<BaseResponse<UserInfo>> login(@Body UserInfo userInfo);

    @PUT("wx/user/bind")
    Observable<BaseResponse> bindChildPhone(@Body UserInfo userInfo);

    @GET("wx/message/menu")
    Observable<BaseResponse<List<MessageInfo>>> getMessageMenuList(@Query("masterId") String masterId);

    @GET("wx/message/list")
    Observable<BaseResponse<List<MessageInfo>>> getMessageDetailList(@Query("conversationId") String conversationId);

    @PUT("wx/user/{id}/activatecode")
    Observable<BaseResponse> bindActivateCode(@Path("id") String id, @Body UserInfo userInfo);


    @POST("wx/user/devicetoken")
    Observable<BaseResponse> uploadDeviceToken(@Body UserInfo userInfo);
}
